package com.prabodha.fruitmap;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class TabsActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        TabHost tabHost = getTabHost();
        
        // Tab for Photos
        TabSpec photospec = tabHost.newTabSpec("Advertise");
         //setting Title and Icon for the Tab
        photospec.setIndicator("Advertise", getResources().getDrawable(R.drawable.advertise_icon));
        Intent photosIntent = new Intent(this, Advertise.class);
        photospec.setContent(photosIntent);
 
         //Tab for Songs
          TabSpec songspec = tabHost.newTabSpec("Search");
        songspec.setIndicator("Search", getResources().getDrawable(R.drawable.ic_action_search));
        Intent songsIntent = new Intent(this, Search.class);
        songspec.setContent(songsIntent);
 
        // Tab for Videos
        TabSpec videospec = tabHost.newTabSpec("Support");
        videospec.setIndicator("Support", getResources().getDrawable(R.drawable.support));
        Intent videosIntent = new Intent(this, Support.class);
        videospec.setContent(videosIntent);
 
         //Adding all TabSpec to TabHost
        tabHost.addTab(photospec); // Adding photos tab
        tabHost.addTab(songspec); // Adding songs tab
        tabHost.addTab(videospec); // Adding videos tab
    }
}